package cn.xuguowen.user.designPatten.factory.customer_abstract_factory;

/**
 * ClassName: ShapeFactory
 * Package: cn.xuguowen.user.designPatten.factory.customer_abstract_factory
 * Description:
 * 形状工厂——生产具体形状产品的
 * @Author 徐国文
 * @Create 2023/4/27 14:45
 * @Version 1.0
 */
public class ShapeFactory extends AbstractFactory {
    @Override
    public Color getColor(String color) {
        return null;
    }

    @Override
    public Shape getShape(String shapeType) {
        Shape shape = null;
        if (shapeType.equalsIgnoreCase("CIRCLE")) {
            shape =  new Circle();
        } else if (shapeType.equalsIgnoreCase("RECTANGLE")) {
            shape =  new Rectangle();
        } else if (shapeType.equalsIgnoreCase("SQUARE")) {
            shape =  new Square();
        }
        return shape;
    }
}
